package com.inifitness.common.xxl;

import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.service.annotation.HttpExchange;
import org.springframework.web.service.annotation.PostExchange;

/**
 * TODO: (sunjinfeng 2024-06-06)
 *
 * @author sunjinfeng
 * @version 1.0.0
 * @since 2024-06-06 13:48
 */

@HttpExchange(accept = MediaType.APPLICATION_JSON_VALUE, contentType = MediaType.APPLICATION_JSON_VALUE)
public interface XxlJobClient {

  @PostExchange("/job/add")
  void addJob(@RequestBody XxlJobInfo jobInfo);

  @PostExchange("/job/addAndStart")
  void addAndStart(@RequestBody XxlJobInfo jobInfo);

  @PostExchange("/job/start")
  void startJob(@RequestParam("id") String id);

  @PostExchange("/job/stop")
  void stopJob(@RequestParam("id") String id);

  @PostExchange("/job/remove")
  void removeJob(@RequestParam("id") String id);
}
